package net.kuratkoo.jidelnicekvut;

import android.content.ContentValues;
import android.content.Context;
import java.sql.Time;

public class CanteenHour {
    private static final String TAG = "JidelnicekVUT|CanteenHour";
    public Integer canteenId;
    public Integer day; // 1 = po-ct, 5 = pa, 6 = so-ne
    public Time from;
    public Time to;
    private Context context;

    CanteenHour(Context context) {
        this.context = context;
    }

    public void save() {
        DatabaseAdapter db = new DatabaseAdapter(this.context);
        ContentValues values = new ContentValues();
        values.put("canteen_id", this.canteenId);
        values.put("day", this.day);
        values.put("time_from", this.from.toString());
        values.put("time_to", this.to.toString());
        db.getDb().insertOrThrow("canteen_hours", null, values);
        db.close();
    }
}
